import SearchImageMenuConfig from "./menus/SearchImageMenu.js";
import SearchVideoMenuConfig from "./menus/SearchVideoMenu.js";

import { IRegisterMenuConf } from "@wangeditor/core";

const MenuConfig: { [name: string]: IRegisterMenuConf } = {
  SearchImageMenuConfig,
  SearchVideoMenuConfig,
};

import type { App } from "vue";
// @ts-ignore
import { Boot } from "@wangeditor/editor";

export default {
  install(_app: App) {
    // install方法， Object.keys()得到对象所有的key
    Object.keys(MenuConfig).forEach((key: string) => {
      Boot.registerMenu(MenuConfig[key]);
    });
  }
};
